<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>AILabel</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="./static/docsify/vue.css">
  <link rel="stylesheet" href="./static/css/index.css">
  <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
  <div class="header">2020 AILabel 与你一路同行</div>
  <div id="app"></div>
  <script>
    window.$docsify = {
        // loadNavbar: true,
        // loadSidebar: true,
        // search: 'auto', // 默认值
        plugins: [
        function (hook) {
            hook.doneEach(function () {

            let max_cengji = 1;    //默认展开层级深度
            //添加箭头
            $('.sidebar-nav').find('li').each(function (i, e) {
              var el = e;
              if (el.nextSibling && el.nextSibling.tagName == 'UL') {
                $(el).addClass('sidebar-nav-parent-li').append(
                  "<div class='ul-after'><div class='ul-after-sanjiao'></div></div>");
              }
            })

            //初始时候展开层级
            function find_children_li(dom, current_cengji) {
              if (dom) {
                current_cengji++;
                $($(dom).find('li').each(function (i, e) {
                  var el = e;
                  if (el.nextSibling && el.nextSibling.tagName == 'UL') {
                    if (current_cengji >= max_cengji) {
                      $(el.nextSibling).hide();
                      $(el).addClass('sidebar-nav-parent-li-shouqi');
                    }
                    find_children_li(el.nextSibling, current_cengji);
                  }
                }))
              } else {
                return
              }
            }

            find_children_li($('.sidebar-nav')[0], 0);

            //绑定事件
            $('.ul-after-sanjiao').on('click', function (e) {
            //   e.stopPropagation();
            //   e.preventDefault();
              var el = e.target.parentNode.parentNode.nextSibling;
              if (el) {
                $(el).toggle();
                if ($(e.target.parentNode.parentNode).hasClass('sidebar-nav-parent-li-shouqi')) {
                  $(e.target.parentNode.parentNode).removeClass('sidebar-nav-parent-li-shouqi');
                } else {
                  $(e.target.parentNode.parentNode).addClass('sidebar-nav-parent-li-shouqi');
                }
              }
            })
          })
        }
      ],
        maxLevel: 2,
        name: 'AILabel',
        // repo: 'ssh://dingyang@icode.baidu.com:8235/baidu/personal-code/gDBox'
    }
  </script>
  <script src="./static/docsify/docsify.min.js"></script>
  <!-- <script src="//unpkg.com/docsify"></script>
  <script src="//unpkg.com/prismjs/components/prism-bash.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-php.js"></script> -->
  <script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b13f8c8b80f29406d4bd21b98f268578";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
  </script>
</body>
</html>
